using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Domains
{
    /// <summary>
    /// <para>Sort Coded Value Domain</para>
    /// <para>Sorts the code or description of a coded value domain in either ascending or descending order.</para>
    /// <para>按升序或降序对编码值域的代码或说明进行排序。</para>
    /// </summary>    
    [DisplayName("Sort Coded Value Domain")]
    public class SortCodedValueDomain : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SortCodedValueDomain()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_workspace">
        /// <para>Input Workspace</para>
        /// <para>The geodatabase containing the domain to be sorted.</para>
        /// <para>包含要排序的属性域的地理数据库。</para>
        /// </param>
        /// <param name="_domain_name">
        /// <para>Domain Name</para>
        /// <para>The name of the coded value domain to be sorted.</para>
        /// <para>要排序的编码值属性域的名称。</para>
        /// </param>
        /// <param name="_sort_by">
        /// <para>Sort By</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the code or description will be used to sort the domain.</para>
        ///   <bulletList>
        ///     <bullet_item>Code—Records are sorted based on the code value for the domain.</bullet_item><para/>
        ///     <bullet_item>Description—Records are sorted based on the description value for the domain.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否使用代码或说明对域进行排序。</para>
        ///   <bulletList>
        ///     <bullet_item>代码 - 根据属性域的代码值对记录进行排序。</bullet_item><para/>
        ///     <bullet_item>描述 - 根据属性域的描述值对记录进行排序。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_sort_order">
        /// <para>Sort Order</para>
        /// <para><xdoc>
        ///   <para>Specifies the direction the records will be sorted.</para>
        ///   <bulletList>
        ///     <bullet_item>Ascending—Records are sorted from low value to high value.</bullet_item><para/>
        ///     <bullet_item>Descending—Records are sorted from high value to low value.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定记录的排序方向。</para>
        ///   <bulletList>
        ///     <bullet_item>升序 - 记录按从低值到高值排序。</bullet_item><para/>
        ///     <bullet_item>降序 - 记录按高值到低值的顺序排序。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public SortCodedValueDomain(object _in_workspace, object _domain_name, _sort_by_value _sort_by, _sort_order_value _sort_order)
        {
            this._in_workspace = _in_workspace;
            this._domain_name = _domain_name;
            this._sort_by = _sort_by;
            this._sort_order = _sort_order;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Sort Coded Value Domain";

        public override string CallName => "management.SortCodedValueDomain";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_workspace, _domain_name, _sort_by.GetGPValue(), _sort_order.GetGPValue(), _out_workspace];

        /// <summary>
        /// <para>Input Workspace</para>
        /// <para>The geodatabase containing the domain to be sorted.</para>
        /// <para>包含要排序的属性域的地理数据库。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_workspace { get; set; }


        /// <summary>
        /// <para>Domain Name</para>
        /// <para>The name of the coded value domain to be sorted.</para>
        /// <para>要排序的编码值属性域的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Domain Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _domain_name { get; set; }


        /// <summary>
        /// <para>Sort By</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the code or description will be used to sort the domain.</para>
        ///   <bulletList>
        ///     <bullet_item>Code—Records are sorted based on the code value for the domain.</bullet_item><para/>
        ///     <bullet_item>Description—Records are sorted based on the description value for the domain.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否使用代码或说明对域进行排序。</para>
        ///   <bulletList>
        ///     <bullet_item>代码 - 根据属性域的代码值对记录进行排序。</bullet_item><para/>
        ///     <bullet_item>描述 - 根据属性域的描述值对记录进行排序。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Sort By")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _sort_by_value _sort_by { get; set; }

        public enum _sort_by_value
        {
            /// <summary>
            /// <para>Code</para>
            /// <para>Code—Records are sorted based on the code value for the domain.</para>
            /// <para>代码 - 根据属性域的代码值对记录进行排序。</para>
            /// </summary>
            [Description("Code")]
            [GPEnumValue("CODE")]
            _CODE,

            /// <summary>
            /// <para>Description</para>
            /// <para>Description—Records are sorted based on the description value for the domain.</para>
            /// <para>描述 - 根据属性域的描述值对记录进行排序。</para>
            /// </summary>
            [Description("Description")]
            [GPEnumValue("DESCRIPTION")]
            _DESCRIPTION,

        }

        /// <summary>
        /// <para>Sort Order</para>
        /// <para><xdoc>
        ///   <para>Specifies the direction the records will be sorted.</para>
        ///   <bulletList>
        ///     <bullet_item>Ascending—Records are sorted from low value to high value.</bullet_item><para/>
        ///     <bullet_item>Descending—Records are sorted from high value to low value.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定记录的排序方向。</para>
        ///   <bulletList>
        ///     <bullet_item>升序 - 记录按从低值到高值排序。</bullet_item><para/>
        ///     <bullet_item>降序 - 记录按高值到低值的顺序排序。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Sort Order")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _sort_order_value _sort_order { get; set; }

        public enum _sort_order_value
        {
            /// <summary>
            /// <para>Ascending</para>
            /// <para>Ascending—Records are sorted from low value to high value.</para>
            /// <para>升序 - 记录按从低值到高值排序。</para>
            /// </summary>
            [Description("Ascending")]
            [GPEnumValue("ASCENDING")]
            _ASCENDING,

            /// <summary>
            /// <para>Descending</para>
            /// <para>Descending—Records are sorted from high value to low value.</para>
            /// <para>降序 - 记录按高值到低值的顺序排序。</para>
            /// </summary>
            [Description("Descending")]
            [GPEnumValue("DESCENDING")]
            _DESCENDING,

        }

        /// <summary>
        /// <para>Updated Input Workspace</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Workspace")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_workspace { get; set; }


        public SortCodedValueDomain SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}